1. Field of the Invention
The present invention relates to digital image and video processing. More specifically, the present invention relates to methods of image filtering the surfaces of three-dimensional (3D) objects and texture projections.
2. Discussion of Related Art
Traditionally, digital images are captured, displayed and processed as a rectangle in two dimensions. As illustrated in FIG. 1, a digital image 100 comprises a plurality of picture elements (pixels). Specifically, digital image 100 comprises Y rows of X pixels. For clarity, pixels in an digital image are identified using a two-dimensional coordinate system. As shown in FIG. 1, pixel P(0,0) is in the top left corner of digital image 100. Pixel P(Xxe2x88x921,0) is in the top right corner of digital image 100. Pixel P(0,Yxe2x88x921) is in the bottom left corner and pixel P(Xxe2x88x921, Yxe2x88x921) is in the bottom right corner.
Many linear image filtering techniques to perform such tasks as noise reduction, edge detection, and image enhancement, have been developed for use with the traditional two-dimensional digital image. A linear filter operation is usually implemented as a discrete convolution operation with the convolution kernal being the filter kernel or filter mask. This process is illustrated in FIG. 2, where a moving window mask, usually referred to as a filter mask, centered around a particular pixel is moved across the image. The value of the center pixel, i.e., the center pixel value, is re-assigned a value equal to the sum of each filter kernel value multiplied with the underlying pixel value. FIG. 2 shows a digital image 200 with a filter mask 210 centered around pixel P(X, Y). Filter mask 210 is a 5xc3x975 mask and includes 25 pixels. Specifically, filter mask 210 includes the pixels in a square having corner pixels P(Xxe2x88x922, Yxe2x88x922), P(X+2, Yxe2x88x922), P(Xxe2x88x922, Y+2), and P(X+2, Y+2). During an image filtering operation, filter mask 210 spans across every pixel in digital image 200 and the filtering operation is performed for each pixel. However, pixels along the 2 rows or columns on the edges of digital image 200 can not be fully processed because pixel mask 210 would not have complete data to process the pixels at the edges. Generally, these border pixels are either not filtered or filtered using predefined border parameters. For example, some image processing systems define additional pixels around digital image 200 to allow filtering of the border pixels of digital image 200. Typically, a dark background color is chosen for the additional pixels. Alternatively, the additional pixels may be based on the border pixels or determined through an extrapolation of the border pixels.
With increasing processing and memory capabilities, computer systems can be used for advanced graphic processing of three-dimensional imaging, such as displaying environment maps and three-dimensional objects using so-called texture maps. However, many graphic hardware systems are designed for handling texture maps only as two dimensional digital images. Furthermore, computer memory addressing is not well suited for three dimensional imaging. Thus, most graphic images are still stored and processed as two dimensional images. However, in many situations the border conditions of two dimensional texture maps do not reflect the actual conditions of the three-dimensional object or environment because the surface of the three-dimensional object or environment is represented in this texture map as a two-dimensional digital image. For example, a cylinder is xe2x80x9cunwrappedxe2x80x9d into a two dimensional texture map. The two dimensional texture map has a left and right border whereas the actual cylinder does not have a left or right border. Hence, there is a for a method and system to allow image filtering techniques on two-dimensional digital images to be applied to three-dimensional imaging.
Accordingly, the present invention provides a method and system for applying image filters on the surfaces of three dimensional objects or environments. For example, in one embodiment of the present invention a texture map of a three-dimensional object or a texture projection of an environment having a first face and a second face is filtered by using texels from the second face to filter texels on the edges of the first face. Furthermore, texels from the first face are also used to filter texels on the edges of the second face. Generally, a texel is filtered with a filter mask surrounding the texel. However, for texels near the edges of the first face, the filter mask would extend beyond the edge of first face and contain empty spaces. However, in an embodiment of the present invention, a first-face to second-face pointer, which is associated with an edge of the first face, points to a side in the second face. Using the first-face to second-face pointer, a partial filter mask is defined in the second face. The partial filter mask includes a plurality of second-face texels which are used to filter the texel in the first face. Similarly, a texel near an edge of the second face can be filtered using a plurality of first-face texels. Furthermore, some embodiments of the present invention includes a stride parameter with the first-face to second face pointer. For example, in some embodiments, the stride parameter is the amount a memory pointer must be incremented to point to an adjacent face pixel. The stride parameter can also provides information regarding the relative orientation of the first face and the second face. In accordance with a second embodiment of the present invention, the first face and second face are stored in a texture map. Furthermore, the first-face to second-face pointer is also stored in the texture map. Furthermore, additional faces and pointers can also be stored in the texture map. Some embodiments also include the stride parameter in the texture map.